import React, { Component } from 'react'
import { HashRouter, Route, Switch } from 'react-router-dom'
import App from '../App'
import Admin from '../admin'
import Login from '../pages/login'
import Home from '../pages/home'
import Buttons from '../pages/ui/buttons'
import Modals from '../pages/ui/modals'
import Loadings from '../pages/ui/loadings'
import Notice from '../pages/ui/notice'
import Messages from '../pages/ui/messages'
import Tabs from '../pages/ui/tabs'
import Gallery from '../pages/ui/gallery'
import Carousels from '../pages/ui/carousels'
import NoFound from '../pages/noFound'

class Router extends Component {
    render() {
        return (
            <HashRouter>
                <App>
                    <Route path="/login" component={Login} />
                    <Route path="/" render={() =>
                        <Admin>
                            <Switch>
                                <Route path="/home" component={Home} />
                                <Route path="/ui/buttons" component={Buttons} />
                                <Route path="/ui/modals" component={Modals} />
                                <Route path="/ui/loadings" component={Loadings} />
                                <Route path="/ui/notification" component={Notice} />
                                <Route path="/ui/messages" component={Messages} />
                                <Route path="/ui/tabs" component={Tabs}/>
                                <Route path="/ui/carousel" component={Carousels}/>
                                <Route path="/ui/gallery" component={Gallery}/>
                                <Route component={NoFound} />
                            </Switch>
                        </Admin>
                    }></Route>
                </App>
            </HashRouter>
        )
    }
}

export default Router